<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>学生表操作</title>

		<link href="<%=basePath%>js/calendar/skins/aqua/theme.css"
			rel="stylesheet" />
		<link href="<%=basePath%>js/validate/jquery.validate.css"
			rel="stylesheet" />
		<script type="text/javascript" src="<%=basePath%>js/jquery-1.4.2.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/validate/jquery.validate.js"></script>
		<script type="text/javascript" charset="UTF-8"
			src="<%=basePath%>js/validate/messages_cn.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/calendar-setup.js"></script>
		<script type="text/javascript"
			src="<%=basePath%>js/calendar/lang/calendar-zh_CN.js"></script>

		<script type="text/javascript">
	$(function() {
		jQuery.validator.addMethod("tel_validate",
				function(value, element) {
					return this.optional(element) || /^(((13[0-9]{1})|(15[0-9]{1}))+\d{8})$/.test(value);
				}, "请输入合法的电话号码！");

		$("#studentInfoInsertForm").validate( {
			rules : {
				"studentInfo.stuName" : {
					required : true,
					maxlength : 50
				},
				"studentInfo.tel" : {
					required:true,
					tel_validate:true,
					number:true
				},
				"studentInfo.address" : {
					required : true,
					maxlength : 20
				}
			}
		})
	});
</script>
	</head>

	<body bgcolor="#D6E0EF">
		<div align="center">
			<form name="studentInfoInsertForm" id="studentInfoInsertForm"
				method="post" action="BasicInfo!studentInfoInput">
				<table align="center">
					<tr>
						<td>
							姓&nbsp;&nbsp;&nbsp;&nbsp;名：
						</td>
						<td align="left">
							<input type="text" name="studentInfo.stuName"
								id="studentInfo.stuName" value="" />
						</td>
					</tr>
					<tr>
						<td>
							出生年月：
						</td>
						<td align="left">
							<input type="text" name="studentInfo.birth_date"
								id="studentInfo.birth_date" value="" readonly="readonly" />
							<img id="birthdateTime"
								src="<%=basePath%>js/calendar/skins/aqua/cal.gif"
								style="cursor: pointer;" />
						</td>
					</tr>
					<tr>
						<td>
							入学时间：
						</td>
						<td align="left">
							<input type="text" name="studentInfo.create_date"
								id="studentInfo.create_date" value="" readonly="readonly" />
							<img id="createdateTime"
								src="<%=basePath%>js/calendar/skins/aqua/cal.gif"
								style="cursor: pointer;" />
						</td>
					</tr>
					<tr>
						<td>
							性&nbsp;&nbsp;&nbsp;&nbsp;别:
						</td>
						<td align="left">
							<input type="radio" name="studentInfo.sex" id="studentInfo.sex"
								value="男" checked="checked" />
							男
							<input type="radio" name="studentInfo.sex" id="studentInfo.sex"
								value="女" />
							女
						</td>
					</tr>

					<tr>
						<td>
							电&nbsp;&nbsp;&nbsp;&nbsp;话：
							</td>
						<td align="left">
							<input type="text" name="studentInfo.tel" id="studentInfo.tel"
								value="" />
						</td>
					</tr>
					<tr>
						<td>
							家庭住址：
						</td>
						<td align="left">
							<input type="text" name="studentInfo.address"
								id="studentInfo.address" value="" />
						</td>
					</tr>
					<tr>
						<td>
							班&nbsp;&nbsp;&nbsp;&nbsp;级：
						</td>
						<td align="left">
							<select name="classInfo.id" id="classInfo.id">
								<s:iterator value="classInfoList">
									<option value="<s:property value="id"/>">
										<s:property value="className" />
									</option>
								</s:iterator>
							</select>
						</td>
					</tr>
					<tr>
						<td>
							备&nbsp;&nbsp;&nbsp;&nbsp;注：
						</td>
						<td align="left">
							<input type="text" name="studentInfo.memo" id="studentInfo.memo"
								value="" />
						</td>
					</tr>
					<tr>
						<td></td>
						<td>
							<input type="submit" name="button" id="button" value="插入表数据" />
						</td>
					</tr>
				</table>
			</form>
		</div>
	</body>
	<script type="text/javascript">
	Calendar.setup( {
		inputField : "studentInfo.birth_date",
		ifFormat : "%Y-%m-%d",
		showsTime : "true",
		button : "birthdateTime",
		step : 1
	});
	Calendar.setup( {
		inputField : "studentInfo.create_date",
		ifFormat : "%Y-%m-%d",
		showsTime : "true",
		button : "createdateTime",
		step : 1
	});
</script>
</html>
